<template>
    <div>
        <comp ref="bar" :params="params" height="300px" width="100%" />
    </div>
</template>
<script>
import comp from "./../bar/index";
export default {
    name: "barLinear",
    title: "渐变柱子",
    theme: "white",
    components: { comp },
    data() {
        return {
            params:{},
            dataCols: {
                dimension: ["日期"], //必填
                legend: {
                    data: ["类型1", "类型2"], //必填
                },
                series: [
                    {
                        日期: "1-1", //此处可不修改，和demension一样即可
                        类型1: 1, // 和legend里面的data里面的数据对应
                        类型2: "20",
                        类型3: "40",
                        类型4: "60",
                    },
                    {
                        日期: "1-2",
                        类型1: 2,
                        类型2: "21",
                        类型3: "41",
                        类型4: "61",
                    },
                    {
                        日期: "1-3",
                        类型1: 3,
                        类型2: "22",
                        类型3: "42",
                        类型4: "62",
                    },
                    {
                        日期: "1-4",
                        类型1: 4,
                        类型2: "23",
                        类型3: "43",
                        类型4: "63",
                    },
                    {
                        日期: "1-5",
                        类型1: 5,
                        类型2: "24",
                        类型3: "44",
                        类型4: "64",
                    },
                ],
            },
            setting: {
                theme: "black",
                color: [],

                series: {
                    linear: {
                        类型1: ["transparent", "#17AAFE"],
                        类型2: ["transparent", "#f90"],
                    },
                    barWidth: "",
                },
            },
        };
    },
    mounted() {
        this.$nextTick(() => {
            let param = {
                dataCols: this.dataCols,
                setting: this.setting,
            };
            this.params ={...param};
            // this.$refs.bar.initChart(param);
        });
    },
};
</script>